package com.shigen.demo.entity.req;

import com.shigen.demo.bean.PageRequest;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import lombok.Data;
import lombok.EqualsAndHashCode;

public class ProjectReq {

  @Data
  @ApiModel(value = "问卷请求体")
  public static class OpBase {

    @ApiModelProperty(value = "问卷的名字")
    @NotEmpty(message = "项目名称不能为空")
    private String projName;

    @ApiModelProperty(value = "每人只能填写一次 0----false 1----true")
    private boolean writeOnce;

    @ApiModelProperty(value = "开始时间")
    @NotEmpty(message = "开始时间不能为空")
    private String beginTime;

    @ApiModelProperty(value = "结束时间")
    @NotEmpty(message = "结束时间不能为空")
    private String endTime;

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "描述")
    @NotEmpty(message = "描述文字不能为空")
    private String describe;

    @ApiModelProperty(value = "表单的组件")
    @NotEmpty(message = "表单控件不能为空")
    private String list;

    @ApiModelProperty(value = "表单的配置信息")
    private String config;
  }

  @Data
  @EqualsAndHashCode(callSuper = true)
  @ApiModel(value = "项目的分页查询")
  public static class QueryItem extends PageRequest {
    @ApiModelProperty(value = "根据项目名或项目描述查询")
    private String param;
  }

  @Data
  @EqualsAndHashCode(callSuper = true)
  public static class UpdateItem extends OpBase {

    @NotEmpty(message = "表单的id不能为空")
    private String projId;

    private Boolean isStop;
  }
}
